﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Core;
using Tanmia.Basis.ViewModel;
using Tanmia.Domain;
using System.ComponentModel;
using System.Windows.Data;

namespace Tanmia.Windows.PersonScenario
{
    public class PersonViewModel : BaseViewModel<Person>
    {
        public ICollectionView Accounts { get; private set; }

        private AccountDomain AccountDomainObj = new AccountDomain();

        public PersonViewModel()
            : base(new PersonDomain())
        {
            UpdateAccounts();
        }

        public void UpdateAccounts()
        {
            Accounts = CollectionViewSource.GetDefaultView(AccountDomainObj.GetsWithAccountTools(AccountTools.Person));

            RaisePropertyChanged("Accounts");
        }
    }
}
